<template>
  <div>
    <div>
      <i
        class="el-icon-collection"
        style="margin-right: 10px;"
      />
      <h5>服务级错误码参照(error_code)：</h5>
      <el-table :data="serverData" stripe class="error-table">
        <el-table-column prop="errorCode" label="错误码" width="200">
        </el-table-column>
        <el-table-column prop="illustrate" label="说明" width="917">
        </el-table-column>
      </el-table>

    </div>
    <div>
      <i
        class="el-icon-collection"
        style="margin-right: 10px;"
      />
      <h5>系统级错误码参照：</h5>
      <el-table :data="systemData" stripe class="error-table">
        <el-table-column prop="systemErrorCode" label="错误码" width="200">
        </el-table-column>
        <el-table-column prop="systemIllustrate" label="说明" width="717">
        </el-table-column>
        <el-table-column prop="oldVersion" label="旧版本">
        </el-table-column>
      </el-table>

    </div>
    <div>
      <i
        class="el-icon-collection"
        style="margin-right: 10px;"
      />
      <h5>错误码格式说明（示例：200201）：</h5>
      <el-table :data="formatData" stripe class="error-table">
        <el-table-column prop="format2" label="2" width="200">
        </el-table-column>
        <el-table-column prop="format002" label="002" width="717">
        </el-table-column>
        <el-table-column prop="format01" label="01">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DocError',
  data() {
    return {
      keywors: '',
      serverData: [],
      systemData: [],
      formatData: [],
    }
  },
  mounted () {
    this.getAPILis()
  },
  methods: {
    getAPILis () {
      this.$axios.get('/error/list', {
        params: {
          keywords: this.keywords
        }
      }).then(({ data: res}) => {
        console.log(res.data)
        console.log(res.systemData);
        if (res.code === 200) {
          this.serverData = res.data
          this.systemData = res.systemData
          this.formatData = res.formatData
        }else {
          this.$message.error('错了哦，这是一条错误消息');
        }
      })
    },
  }
}
</script>

<style>
.main-container {
  padding: 0 200px;
  min-height: 500px;
  line-height: 20px;
  margin-block: 3rem;
}
.error-table{
  width: 100%;
  font-size: 12px;
  border: 1px solid #e7e7e7;
  text-align: center;
  color: #777;
  margin-top: 1rem;
  margin-bottom: 3rem;
}
h5{
  display: inline;
}
</style>
